package com.funtl.screw.admin.controller;

import com.funtl.screw.admin.service.RedisService;
import com.funtl.screw.common.core.util.ResponseResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

/**
 * @author Lusifer
 * @since 2019-05-08
 * <p>
 * redis 数据
 */
@RestController
@AllArgsConstructor
@Api(value = "redis", tags = "缓存监控")
@RequestMapping("/redis")
public class RedisController {

	private final RedisService redisService;

	/**
	 * 查询redis信息
	 */
	@ApiOperation(value = "查询redis信息", notes = "查询redis信息")
	@GetMapping("/info")
	public ResponseResult<Map<String, Object>> memory() {
		return ResponseResult.ok(redisService.getInfo());
	}

}
